<?php /* Smarty version Smarty-3.1.13, created on 2015-05-21 08:40:09
         compiled from ".\templates\login.html" */ ?>
<?php /*%%SmartyHeaderCode:14174555d70c065fe11-61394728%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '05b143acdc50731311b48d7001385e844715105d' => 
    array (
      0 => '.\\templates\\login.html',
      1 => 1432190400,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '14174555d70c065fe11-61394728',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_555d70c06d12b4_19847179',
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_555d70c06d12b4_19847179')) {function content_555d70c06d12b4_19847179($_smarty_tpl) {?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<title>用户注册</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="stylesheet" href="lib/css/bootstrap.css">
<link rel="stylesheet" href="lib/css/font-awesome.css">
<link rel="stylesheet" href="lib/css/style.css">
<link rel="stylesheet" href="lib/css/style.less">
<script src="lib/js/jquery-1.11.0.min.js"></script>
<script src="lib/js/less-1.5.0.min.js"></script>
<script src='lib/js/jquery.validate.min.js'></script>
<script src="lib/js/bootstrap.js"></script>
<script src="lib/js/bootbox.js"></script>
<script>
        $(document).ready(function() {
            function validateform() {
                return $("#form").validate({
                        rules: {
                            'email': {
                                required: true,
                                email:true
                            },
                            'pwd': {
                                required: true,
                            }
                        },
                        messages: {
                            'email': {
                                required: '请填写邮箱',
                                email:'请填写正确的邮箱'
                            },
                            'pwd': {
                                required: '请填写密码'
                            }
                        }
                    }).form();
          }
            

            $("#submit").on('click',function() {
                var result = validateform();
                if(result) {
                   $.ajax({
                     url: 'login.php',
                     data: 'email='+$("#email").val()+'&pwd='+$("#pwd").val(),
                     type: 'POST',
                     success: function(res) {
                    	 //未注册
                        if(res==1){
                        	bootbox.alert('请先注册');
                        }//登陆成功
                        else if(res==2){
                        	window.location.href="file.php";
                        }//密码错误
                        else if(res==3){
                        	bootbox.alert('密码错误');
                        }
                        
                     }
                   });
                }  
            });
        });
</script>
</head>
<body>
    <div id="validate-container"  class="container body-bg">
        <div id="header" style="height:50px;">
            
        </div>
        <div id="main" >
            <form action="" class="form-inline" id="form">
                <div class="main-div">
                    <div  class="secendary-div  ">邮箱</div>
                    <input type="text"  class="secendary-input form-control " id="email" name="email" >
                </div>
                <div class="main-div">
                    <div  class="secendary-div">密码</div>
                    <input type="text"  class="secendary-input form-control" id="pwd" name="pwd" >
                </div>
                     <a href="reg.php" class="btn btn-default  btn-xs">
                       注册
                     </a>
               <button type="button"  class="btn btn-default btn-lg" id="submit">登入</button>
            </form>
        </div>
        <div id="footer" >
        </div>
    </div>

</body>
</html>
<?php }} ?>